Optimal. Leaf size=60 \[ -\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \sec (e+f x)}{\sqrt{a-b}}\right )}{a f \sqrt{a-b}}-\frac{\tanh ^{-1}(\cos (e+f x))}{a f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0702532, antiderivative size = 60, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {3664, 391, 207, 205} \[ -\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \sec (e+f x)}{\sqrt{a-b}}\right )}{a f \sqrt{a-b}}-\frac{\tanh ^{-1}(\cos (e+f x))}{a f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3664
Rule 391
Rule 207
Rule 205
Rubi steps
\begin{align*} \int \frac{\csc (e+f x)}{a+b \tan ^2(e+f x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{1}{\left (-1+x^2\right ) \left (a-b+b x^2\right )} \, dx,x,\sec (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \frac{1}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{a f}-\frac{b \operatorname{Subst}\left (\int \frac{1}{a-b+b x^2} \, dx,x,\sec (e+f x)\right )}{a f}\\ &=-\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \sec (e+f x)}{\sqrt{a-b}}\right )}{a \sqrt{a-b} f}-\frac{\tanh ^{-1}(\cos (e+f x))}{a f}\\ \end{align*}
Mathematica [B] time = 0.205482, size = 144, normalized size = 2.4 \[ \frac{\sqrt{b} \sqrt{a-b} \tan ^{-1}\left (\frac{\sqrt{a-b}-\sqrt{a} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{b}}\right )+\sqrt{b} \sqrt{a-b} \tan ^{-1}\left (\frac{\sqrt{a-b}+\sqrt{a} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{b}}\right )-(a-b) \left (\log \left (\cos \left (\frac{1}{2} (e+f x)\right )\right )-\log \left (\sin \left (\frac{1}{2} (e+f x)\right )\right )\right )}{a f (a-b)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.063, size = 75, normalized size = 1.3 \begin{align*} -{\frac{\ln \left ( \cos \left ( fx+e \right ) +1 \right ) }{2\,fa}}+{\frac{b}{fa}\arctan \left ({ \left ( a-b \right ) \cos \left ( fx+e \right ){\frac{1}{\sqrt{b \left ( a-b \right ) }}}} \right ){\frac{1}{\sqrt{b \left ( a-b \right ) }}}}+{\frac{\ln \left ( \cos \left ( fx+e \right ) -1 \right ) }{2\,fa}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.09132, size = 460, normalized size = 7.67 \begin{align*} \left [\frac{\sqrt{-\frac{b}{a - b}} \log \left (\frac{{\left (a - b\right )} \cos \left (f x + e\right )^{2} + 2 \,{\left (a - b\right )} \sqrt{-\frac{b}{a - b}} \cos \left (f x + e\right ) - b}{{\left (a - b\right )} \cos \left (f x + e\right )^{2} + b}\right ) - \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) + \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right )}{2 \, a f}, -\frac{2 \, \sqrt{\frac{b}{a - b}} \arctan \left (-\frac{{\left (a - b\right )} \sqrt{\frac{b}{a - b}} \cos \left (f x + e\right )}{b}\right ) + \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) - \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right )}{2 \, a f}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\csc{\left (e + f x \right )}}{a + b \tan ^{2}{\left (e + f x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.38654, size = 149, normalized size = 2.48 \begin{align*} -\frac{\frac{2 \, b \arctan \left (-\frac{a \cos \left (f x + e\right ) - b \cos \left (f x + e\right ) - b}{\sqrt{a b - b^{2}} \cos \left (f x + e\right ) + \sqrt{a b - b^{2}}}\right )}{\sqrt{a b - b^{2}} a} - \frac{\log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )}{a}}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]